home *** CD-ROM | disk | FTP | other *** search
- Path: news.lpr.carel.fi!usenet
- From: Ari Lukumies <aril@cmt.lpr.mail.carel.fi>
- Newsgroups: comp.lang.c++
- Subject: Re: default argument problem on rs6000
- Date: Thu, 08 Feb 1996 12:37:12 +0200
- Organization: Carelcomp Forest
- Message-ID: <3119D258.79F6@cmt.lpr.mail.carel.fi>
- References: <4faan9$1rp@fsuj01.rz.uni-jena.de>
- NNTP-Posting-Host: renoir.cclahti.carel.fi
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b6a (WinNT; I)
-
- Tilo Koerbs wrote:
- >
- > When compiling the following code on an rs6000 (ibm) I get an error:
- >
- > struct X {
- > static int f() throw();
- > X(int i = f());
- > };
- > inline int X::f() { return 0; }
- >
- > Error message: "X::f()" was declared with external linkage
- > and called before it is defined as inline.
- >
- > No other compiler reports an error.
- > And I cannot find a constructor call in that code nor can I believe
- > that the declaration of the destructor will evaluate f() .
- >
- > Any comments?
-
- Maybe you mean something like this (?):
-
- struct X {
- int y;
- static int f();
- X(int i = f()) { y = i; }
- };
-
- inline int X::f() { return 1; }
-
- Later,
- AriL
- --
- All my opinions are mine and mine alone.
-